#include<key.h>

key::key(){ ;}
key::key(byte keyPin,byte Intervel)
{
    _keypin = keyPin;
    pinMode(keyPin,INPUT);
    _lasttime = millis();
    _intervel = Intervel;
}

void key::attatch(byte keyPin)
{
    _keypin = keyPin;
    pinMode(_keypin,INPUT);
    _lasttime = millis();
    
}

void key::setIntervel(byte Intervel)
{
    _intervel =Intervel;
}

void key::scan()
{
    bool reading=digitalRead(_keypin);
    if(reading != _lastread)
    {
        _lasttime = millis();
        _lastread = reading;
    }
    if(millis()-lasttime>_intervel)
    {
        
    }
    
}